package com.itheima.controller;

import com.itheima.exception.UserException;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.servlet.http.HttpServletRequest;

/**
 * 处理器异常请求的控制器
 */
@RestController
@RequestMapping("exception")
public class ExceptionController {


    @RequestMapping("/user")
    public void signatureException(HttpServletRequest request) throws UserException {
        throw ((UserException) request.getAttribute("UserException"));
    }

}
